package com.qf.mybatis925.service.impl;

import com.qf.mybatis925.entity.User;
import com.qf.mybatis925.entity.VO.UserVO;
import com.qf.mybatis925.mapper.UserMapper;
import com.qf.mybatis925.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;


@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;


    @Override
    public List<User> getAllUser() {
        return userMapper.findAll();
    }

    @Override
    public Object getUserById(Integer id) {
        return userMapper.findUserById(id);
    }


    @Override
    public User findUserByLogin(User user) {
        return userMapper.findUserByLogin(user);
    }

    @Override
    public List<User> search(HashMap<String, String> map) {
        return userMapper.search(map);
    }

    @Override
    public int delete(User id) {
        return userMapper.delete(id);
    }

    @Override
    public void updateById(User user) {
        userMapper.updateById(user);
    }

    @Override
    public List<User> searchV2(HashMap<String, String> map) {
        return userMapper.searchV2(map);
    }

    @Override
    public void updateById2(User user) {
        userMapper.updateById(user);
    }

    @Override
    public List<UserVO> findUserOrdersById(Integer id) {
        return userMapper.findUserOrdersById(id);
    }


}